<template>
  <div class="child">
    <h3>我是子组件</h3>
    <h4>车子：一辆{{car.brand}}车，价值{{car.price}}万元</h4>
    <GrandChild/>
  </div>
</template>

<script setup lang="ts" name="Child">
  import GrandChild from './GrandChild.vue'
  import { inject } from "vue";
  let car = inject('car',{brand:'未知',price:0})
</script>

<style scoped>
  .child {
    margin-top: 20px;
    background-color: skyblue;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 0 10px black;
  }
</style>